package gewu.suleju.sevice.imp;

import gewu.suleju.dao.iml.IHouseInforOneDao;
import gewu.suleju.model.vo.HouseInforAll;
import gewu.suleju.sevice.ISearchHouseInforOneService;
import gewu.suleju.util.GetHouseInforAllUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Transactional
@Service
public class SearchHouseInforOneServiceImp implements ISearchHouseInforOneService {
    @Autowired
    public IHouseInforOneDao iHouseInforOneDao;

    @Autowired
    public GetHouseInforAllUtil getHouseInforAllUtil;

    @Override
    public List<HouseInforAll> findByRentType(String rentType) {
        return getHouseInforAllUtil.GetHouseInforAll(iHouseInforOneDao.findByRentTypeContainingAndIsStatus(rentType,1));
    }

    @Override
    public List<HouseInforAll> findByArea(String area) {
        return getHouseInforAllUtil.GetHouseInforAll(iHouseInforOneDao.findByAreaContainingAndIsStatus(area,1));
    }

    @Override
    public List<HouseInforAll> findBySubway(String subway) {
        return getHouseInforAllUtil.GetHouseInforAll(iHouseInforOneDao.findBySubwayContainingAndIsStatus(subway,1));
    }
}
